package com.my.chapter14;

import net.mindView.implement.A;
import net.mindView.implement.HiddenC;

import java.lang.reflect.Method;

public class practice25 {
    static void callHiddenMethod(Object a, String methodName)
            throws Exception {
        Method g = a.getClass().getDeclaredMethod(methodName);
        g.setAccessible(true);
        g.invoke(a);
    }

    public static void main(String[] args) throws Exception {
        A a = HiddenC.makeA();
        a.f();
        callHiddenMethod(a,"g");
        callHiddenMethod(a,"u");
        callHiddenMethod(a,"v");
        callHiddenMethod(a,"w");
    }
}
